package top.caoayu.finance;

import lombok.Getter;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Service
@Getter
public class FinanceClient {
    @Resource
    private Map<String, IFinanceService> strategyMap = new ConcurrentHashMap<>(2);

    public IFinanceService getFinanceService(String type) {
        // 根据从 productName 从 strategyMap 集合中查询对应的产品下单策略
        return strategyMap.get(type);
    }
}
